// components/todo-list/todo-list.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    taskId: {
      type: Number
    },
    content: {
      type: String
    },
    showTask: {
      type: Boolean,
      value: false
    },
    checked: {
      type: Boolean
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    yesCheck: "/images/checked.png",
    noCheck: "/images/check.png"
  },

  /**
   * 组件的方法列表
   */
  methods: {
    onCheck: function (event) {
      let that = this
      let checked = this.properties.checked
      this.setData({
        checked: !checked
        
      })
      setTimeout( function () {
        that.setData({
          showTask: true
        })
      },500)
      let taskId = this.properties.taskId
      let behavior = this.properties.checked?taskId:''
      
      this.triggerEvent('checked', {
        behavior: behavior
      }, {})
    }
  }
})
